import matplotlib
matplotlib.use('TkAgg')
import cv2
import numpy as np
import matplotlib.pyplot as plt

# 读取图像
img = cv2.imread('../photo2.jpeg')

# 应用高斯滤波
gaussian_blur = cv2.GaussianBlur(img, (5, 5), 0)

# 显示结果
plt.subplot(121), plt.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
plt.title('Original Image'), plt.xticks([]), plt.yticks([])
plt.subplot(122), plt.imshow(cv2.cvtColor(gaussian_blur, cv2.COLOR_BGR2RGB))
plt.title('Gaussian Blurred Image'), plt.xticks([]), plt.yticks([])
plt.show()